3.466 \(\int \sec ^4(c+d x) (a+i a \tan (c+d x))^n \, dx\)

Optimal. Leaf size=65 \[ \frac{i (a+i a \tan (c+d x))^{n+3}}{a^3 d (n+3)}-\frac{2 i (a+i a \tan (c+d x))^{n+2}}{a^2 d (n+2)} \]

[Out]

((-2*I)*(a + I*a*Tan[c + d*x])^(2 + n))/(a^2*d*(2 + n)) + (I*(a + I*a*Tan[c + d*x])^(3 + n))/(a^3*d*(3 + n))

________________________________________________________________________________________

Rubi [A]  time = 0.0555908, antiderivative size = 65, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.083, Rules used = {3487, 43} \[ \frac{i (a+i a \tan (c+d x))^{n+3}}{a^3 d (n+3)}-\frac{2 i (a+i a \tan (c+d x))^{n+2}}{a^2 d (n+2)} \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]^4*(a + I*a*Tan[c + d*x])^n,x]

[Out]

((-2*I)*(a + I*a*Tan[c + d*x])^(2 + n))/(a^2*d*(2 + n)) + (I*(a + I*a*Tan[c + d*x])^(3 + n))/(a^3*d*(3 + n))

Rule 3487

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rubi steps

\begin{align*} \int \sec ^4(c+d x) (a+i a \tan (c+d x))^n \, dx &=-\frac{i \operatorname{Subst}\left (\int (a-x) (a+x)^{1+n} \, dx,x,i a \tan (c+d x)\right )}{a^3 d}\\ &=-\frac{i \operatorname{Subst}\left (\int \left (2 a (a+x)^{1+n}-(a+x)^{2+n}\right ) \, dx,x,i a \tan (c+d x)\right )}{a^3 d}\\ &=-\frac{2 i (a+i a \tan (c+d x))^{2+n}}{a^2 d (2+n)}+\frac{i (a+i a \tan (c+d x))^{3+n}}{a^3 d (3+n)}\\ \end{align*}

Mathematica [B]  time = 13.4347, size = 143, normalized size = 2.2 \[ -\frac{i 2^{n+3} e^{4 i (c+d x)} \left (e^{i d x}\right )^n \left (\frac{e^{i (c+d x)}}{1+e^{2 i (c+d x)}}\right )^n \left (e^{2 i (c+d x)}+n+3\right ) \sec ^{-n}(c+d x) (\cos (d x)+i \sin (d x))^{-n} (a+i a \tan (c+d x))^n}{d (n+2) (n+3) \left (1+e^{2 i (c+d x)}\right )^3} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]^4*(a + I*a*Tan[c + d*x])^n,x]

[Out]

((-I)*2^(3 + n)*E^((4*I)*(c + d*x))*(E^(I*d*x))^n*(E^(I*(c + d*x))/(1 + E^((2*I)*(c + d*x))))^n*(3 + E^((2*I)*
(c + d*x)) + n)*(a + I*a*Tan[c + d*x])^n)/(d*(1 + E^((2*I)*(c + d*x)))^3*(2 + n)*(3 + n)*Sec[c + d*x]^n*(Cos[d
*x] + I*Sin[d*x])^n)

________________________________________________________________________________________

Maple [C]  time = 0.236, size = 1668, normalized size = 25.7 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^4*(a+I*a*tan(d*x+c))^n,x)

[Out]

-8*I/(2+n)/d/(3+n)/(exp(2*I*(d*x+c))+1)^3*(a^n*2^n*(exp(I*(Re(d*x)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*exp(2*I*(d*x+c))/(exp(2*I*(d
*x+c))+1))*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^2*n)*exp(-1/2*I*Pi*csgn(I*a/(exp(2*I*(d*x+c))+1)*ex
p(2*I*(d*x+c)))^3*n)*exp(-1/2*I*Pi*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))^3*n)*exp(-1/2*I*Pi*csgn(I*exp
(2*I*(d*x+c)))^3*n)*exp(4*I*d*x)*exp(1/2*I*Pi*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2*csgn(I/(exp(2*I*
(d*x+c))+1))*n)*exp(1/2*I*Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2*n)*exp(-
1/2*I*Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(I*(d*x+c)))^2*n)*exp(1/2*I*Pi*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2
*I*(d*x+c)))^2*csgn(I*a)*n)*exp(4*I*c)*exp(-1/2*I*Pi*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I*a/(e
xp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))*csgn(I*a)*n)*exp(I*Pi*csgn(I*exp(2*I*(d*x+c)))^2*csgn(I*exp(I*(d*x+c)))*n
)*exp(-1/2*I*Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I/(exp(2*I*(d*x+c)
)+1))*n)+3*(exp(I*(Re(d*x)+Re(c)))^n)^2/((exp(2*I*(d*x+c))+1)^n)*a^n*2^n*exp(-2*n*Im(d*x)-2*n*Im(c))*exp(1/2*I
*Pi*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^2*n)*exp(-1/
2*I*Pi*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^3*n)*exp(-1/2*I*Pi*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*
x+c))+1))^3*n)*exp(-1/2*I*Pi*csgn(I*exp(2*I*(d*x+c)))^3*n)*exp(4*I*d*x)*exp(1/2*I*Pi*csgn(I*exp(2*I*(d*x+c))/(
exp(2*I*(d*x+c))+1))^2*csgn(I/(exp(2*I*(d*x+c))+1))*n)*exp(1/2*I*Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(2*I*(d
*x+c))/(exp(2*I*(d*x+c))+1))^2*n)*exp(-1/2*I*Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(I*(d*x+c)))^2*n)*exp(1/2*I
*Pi*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^2*csgn(I*a)*n)*exp(4*I*c)*exp(-1/2*I*Pi*csgn(I*exp(2*I*(d*
x+c))/(exp(2*I*(d*x+c))+1))*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))*csgn(I*a)*n)*exp(I*Pi*csgn(I*exp(2
*I*(d*x+c)))^2*csgn(I*exp(I*(d*x+c)))*n)*exp(-1/2*I*Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(2*I*(d*x+c))/(exp(2
*I*(d*x+c))+1))*csgn(I/(exp(2*I*(d*x+c))+1))*n))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4*(a+I*a*tan(d*x+c))^n,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 2.17595, size = 374, normalized size = 5.75 \begin{align*} \frac{{\left ({\left (-8 i \, n - 24 i\right )} e^{\left (4 i \, d x + 4 i \, c\right )} - 8 i \, e^{\left (6 i \, d x + 6 i \, c\right )}\right )} \left (\frac{2 \, a e^{\left (2 i \, d x + 2 i \, c\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )^{n}}{d n^{2} + 5 \, d n +{\left (d n^{2} + 5 \, d n + 6 \, d\right )} e^{\left (6 i \, d x + 6 i \, c\right )} + 3 \,{\left (d n^{2} + 5 \, d n + 6 \, d\right )} e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \,{\left (d n^{2} + 5 \, d n + 6 \, d\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + 6 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4*(a+I*a*tan(d*x+c))^n,x, algorithm="fricas")

[Out]

((-8*I*n - 24*I)*e^(4*I*d*x + 4*I*c) - 8*I*e^(6*I*d*x + 6*I*c))*(2*a*e^(2*I*d*x + 2*I*c)/(e^(2*I*d*x + 2*I*c)
+ 1))^n/(d*n^2 + 5*d*n + (d*n^2 + 5*d*n + 6*d)*e^(6*I*d*x + 6*I*c) + 3*(d*n^2 + 5*d*n + 6*d)*e^(4*I*d*x + 4*I*
c) + 3*(d*n^2 + 5*d*n + 6*d)*e^(2*I*d*x + 2*I*c) + 6*d)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**4*(a+I*a*tan(d*x+c))**n,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n} \sec \left (d x + c\right )^{4}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4*(a+I*a*tan(d*x+c))^n,x, algorithm="giac")

[Out]

integrate((I*a*tan(d*x + c) + a)^n*sec(d*x + c)^4, x)